import Vue from 'vue'
import App from './App.vue'
import router from './router'
import axios from 'axios'
import ElementUI from 'element-ui'
import './assets/index.css'
import APlayer from '@moefe/vue-aplayer';

Vue.use(APlayer, {
  defaultCover: 'https://github.com/u3u.png',
  productionTip: true,
}); 
 
Vue.use(ElementUI)

// 引入
import NProgress from 'nprogress';
import './assets/nprogress/nprogress.css';
// 懒加载
import VueLazyLoad from 'vue-lazyload'
import ImgLoadError from './assets/img-load-error.png'
import Loading from './assets/loading.jpg'

Vue.use(VueLazyLoad, {
  error: ImgLoadError,
  loading: Loading
})

Vue.prototype.axios = axios

Vue.config.productionTip = false


// 进度条配置项这样写
NProgress.configure({
  showSpinner: false
 });
 // 路由跳转前钩子函数中 - 执行进度条开始加载
 router.beforeEach((to, from, next) => {
  NProgress.start();
  next()
 });
 // 路由跳转后钩子函数中 - 执行进度条加载结束
 router.afterEach(() => {
  NProgress.done();
 });

new Vue({
  router,
  render: h => h(App)
}).$mount('#app')
